import request from '@/utils/request'

// 查询赠品列表
export function listGift(query) {
  return request({
    url: '/prod-api/activity/gift/list',
    method: 'get',
    params: query
  })
}

// 查询赠品详细
export function getGift(giftUid) {
  return request({
    url: '/prod-api/activity/gift/' + giftUid,
    method: 'get'
  })
}

// 新增赠品
export function addGift(data) {
  return request({
    url: '/prod-api/activity/gift',
    method: 'post',
    data: data
  })
}

// 修改赠品
export function updateGift(data) {
  return request({
    url: '/prod-api/activity/gift',
    method: 'put',
    data: data
  })
}

// 修改赠品状态
export function updateStatus(giftUid, dataStatus){
  const data = {
    giftUid,
    dataStatus
  }
  return request({
    url: '/prod-api/activity/gift/updateStatus',
    method: 'put',
    data: data
  })
}

// 删除赠品
export function delGift(giftUid) {
  return request({
    url: '/prod-api/activity/gift/' + giftUid,
    method: 'delete'
  })
}
